<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>customer_bill</title>

  <!--  -->

  <link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <link type="text/css" rel="stylesheet" charset="UTF-8"
    href="https://translate.googleapis.com/translate_static/css/translateelement.css">
  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- IonIcons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <style>
    .white_content {
      display: none;
      position: absolute;
      top: 25%;
      left: 25%;
      width: 55%;
      height: 300px;
      padding: 20px;
      border: 1px solid lightgray;
      background-color: white;
      z-index: 1002;
      overflow: auto;
    }
  </style>
  <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
  <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>
<!--
`body` tag options:

  Apply one or more of the following classes to to the body tag
  to get the desired effect

  * sidebar-collapse
  * sidebar-mini
-->

<body class="hold-transition sidebar-mini">
  <div class="wrapper" id="app">
    <div class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-header border-0">
                <nav class=" navbar navbar-expand navbar-white navbar-light">
                  <ul class="navbar-nav nav-sidebar ">
                    <li class="nav-item d-none d-sm-inline-block">
                      <a onclick="document.getElementById('light1').style.display='block';" href="#" class="nav-link">
                        <i class="fas  fa-random nav-icon"></i>
                        <p>导出</p>
                      </a>
                    </li>
                  </ul>
                </nav>
              </div>
              <!-- -->
              <!-- /.card-header -->
              <div class="card-body">
                <div id="example1_wrapper" class="dataTables_wrapper dt-bootstrap4">
                  <div class="row">
                    <div class="col-sm-12">
                      <div id="light1" class="white_content">你好.
                        <a href="javascript:void(0)"
                          onclick="document.getElementById('light1').style.display='none';">关闭</a>
                        <div class="card card-primary">
                          <div class="card-header">
                            <h3 class="card-title">
                              <font style="vertical-align: inherit;">
                                <font style="vertical-align: inherit;">详情</font>
                              </font>
                            </h3>
                            <div class="card-tools">
                              <button type="button" class="btn btn-tool" data-card-widget="collapse"><i
                                  class="fas fa-minus"></i>
                              </button>
                              <button type="button" class="btn btn-tool" data-card-widget="remove"><i
                                  class="fas fa-times"></i></button>
                            </div>
                          </div>
                          <div class="card-body">
                            <div id="export">
                              <a data-type="json" href="javascript:;">导出json</a>

                              <a data-type="txt" href="javascript:;">导出txt</a>

                              <a data-type="csv" href="javascript:;">导出csv</a>

                              <a data-type="xls" href="javascript:;">导出excel</a>

                              <a data-type="doc" href="javascript:;">导出word</a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-12">
                      <table id="example1" class="table table-bordered table-striped dataTable dtr-inline" role="grid"
                        aria-describedby="example1_info">
                        <thead>
                          <tr role="row">
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="操作: activate to sort column ascending">操作</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="期初应收金额: activate to sort column ascending" style="">期初应收金额</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="期末应收金额: activate to sort column ascending" style="">期末应收金额</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="计息金额: activate to sort column ascending" style="">计息金额</th>
                          </tr>
                        </thead>
                        <tbody>
                          <tr role="row" class="odd" style="display: none;">
                            <td class="" tabindex="0"><i class="fas fa-search"></i></td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Epiphany 2.20</td>
                          </tr>
                          <tr v-for="(bill,index) in bills">
                            <td>
                              <i class="fas fa-search"></i>
                            </td>
                            <td>{{bill.before_amount}}</td>
                            <td>{{bill.after_amount}}</td>
                            <td>{{bill.interest}}</td>
                          </tr>
                        </tbody>
                        <tfoot>
                        </tfoot>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- ./wrapper -->

  <!-- REQUIRED SCRIPTS -->

  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js"></script>
  <!-- Bootstrap -->
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <!-- AdminLTE -->
  <script src="dist/js/adminlte.js"></script>

  <!-- OPTIONAL SCRIPTS -->
  <script src="plugins/chart.js/Chart.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="dist/js/demo.js"></script>
  <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  <script src="dist/js/pages/dashboard3.js"></script>
  <!--  -->

  <script src="plugins/datatables/jquery.dataTables.min.js"></script>
  <script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
  <script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
  <script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
  <script src="dist/js/adminlte.min.js"></script>
  <script>
    new Vue({
      el: "#app",
      data: {
        bills: []
      },
      mounted() {
        axios
          .get('clientbill/all')
          .then(res => {
            console.info(res.data);
            this.bills = res.data.data;

          })
      },
      methods: {

      }
    });
  </script>
  <script>
    $(function () {
      $("#example1").DataTable({
        "responsive": true,
        "autoWidth": false,
      });
      $('#example2').DataTable({
        "paging": true,
        "lengthChange": false,
        "searching": false,
        "ordering": true,
        "info": true,
        "autoWidth": false,
        "responsive": true,
      });
    });
  </script>
  <script src="Blob.js"></script>

  <script src="FileSaver.js"></script>

  <script src="tableExport.js"></script>

  <script>
    var $exportLink = document.getElementById('export');

    $exportLink.addEventListener('click', function (e) {

      e.preventDefault();

      if (e.target.nodeName === "A") {

        tableExport('example1', '测试测试', e.target.getAttribute('data-type'));

      }



    }, false);
  </script>
</body>

</html>